From 14108999a53d1e870dadc63743c0c28a3f796735 Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Wed, 31 Jul 2019 18:44:09 -0500 Subject: [PATCH] Try to make the 'resettime' work per https://github.com/gpsbabel/gpsbabel/issues/350 Debugging shows it's sending a time to my USB Garmin, but since this seems to be a non-rollover device, the time is borked on mine anyway. --- garmin.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/garmin.cc b/garmin.cc index 9f5636ca0..f46de6657 100644 --- a/garmin.cc +++ b/garmin.cc @@ -144,16 +144,6 @@ rw_init(const QString& fname) return; } - /* - * THis is Gross. The B&W Vista sometimes sets its time decades into - * the future with no way to reset it. This apparently can "cure" - * an affected unit. - */ - if (resettime) { - GPS_Command_Send_Time(qPrintable(fname), current_time().toTime_t()); - return; - } - if (categorybitsopt) { categorybits = strtol(categorybitsopt, nullptr, 0); } @@ -175,6 +165,18 @@ rw_init(const QString& fname) if (GPS_Init(qPrintable(fname)) < 0) { fatal(MYNAME ":Can't init %s\n", qPrintable(fname)); } + + /* + * THis is Gross. The B&W Vista sometimes sets its time decades into + * the future with no way to reset it. This apparently can "cure" + * an affected unit. + */ + if (resettime) { + GPS_User("Issuing Time Reset...\n"); + GPS_Command_Send_Time(qPrintable(fname), current_time().toTime_t()); + GPS_User("done.\n"); + } + portname = xstrdup(qPrintable(fname)); if (baud && baud != DEFAULT_BAUD) { -- 2.30.2